<?php

namespace App\Repositories\Eloquent;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Container\Container as App;
use Illuminate\Support\Str;
use Illuminate\Support\Carbon;
use Auth, Session, DB, Hash, Config;

class ManageRepository extends Repository
{

    protected $app;
    /**
     * @param App
     */
    public function __construct(App $app)
    {
        parent::__construct($app);
       
    }

    /**
     * 指定模型名称
     *
     * @return mixed
     */
    function model()
    {
        return 'App\Models\Manage';
    }


    public function content($name)
    {
        return $this->model->getByName($name);
    }


    public function renew($request)
    {
        $result = $this->update([
            'content' => $request->intro
        ], $request->id);

        if (!!$result) {
            return $this->responseSuccess('更新成功', $result);
        }

        return $this->responseFail(500, '更新失败');
    }

}